var myApp = angular.module("myApp",["ui.router"]);

myApp.config(function($stateProvider, $urlRouterProvider){
	$urlRouterProvider.otherwise("/login");
	$stateProvider
		.state("/login", {
			url: "/login",
			controller: 'signinCtrl',
			templateUrl: "static/partials/login.html"
		}).state("/register", {
			url: "/register",
			templateUrl: "static/partials/register.html"
		}).state("/", {
			url: "/",
			views: {
				"": { templateUrl: "static/partials/public/body.html" },
				"header@/": { templateUrl: "static/partials/public/header.html" },
				"main@/": { templateUrl: "static/partials/public/main.html" },
				"left@/": { templateUrl: "static/partials/public/left.html" },
				"right@/": { templateUrl: "static/partials/public/right.html" }
			}
		}).state("/.user", {
			url: "user/info",
			controller: "userCtrl",
			views: {
				"right@/": { templateUrl: "static/partials/user/info.html" }
			}
		}).state("/.head_img", {
			url: "user/head_img",
			views: {
				"right@/": { templateUrl: "static/partials/user/head_img.html" }
			}
		}).state("/.passwd", {
			url: "user/passwd",
			views: {
				"right@/": { templateUrl: "static/partials/user/passwd.html" }
			}
		}).state("/.list", {
			url: "user/list",
			views: {
				"right@/": { templateUrl: "static/partials/user/list.html" }
			}
		}).state("/.group", {
			url: "user/group",
			views: {
				"right@/": { templateUrl: "static/partials/user/group.html" }
			}
		}).state("/.role", {
			url: "user/role",
			views: {
				"right@/": { templateUrl: "static/partials/user/role.html" }
			}
		}).state("/.token", {
			url: "user/token",
			views: {
				"right@/": { templateUrl: "static/partials/user/token.html" }
			}
		});

});